home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / tmpnam.man < prev    next >
Encoding:
Text File  |  1989-10-04  |  3.5 KB  |  135 lines

  1.  
  2.  
  3.  
  4. tmpnam                C Library Procedures                 tmpnam
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      tmpnam, tempnam - Generate unique names for temporary files
  12.  
  13. SSYYNNOOPPSSIISS
  14.      iinncclluuddee <<ssttddiioo..hh>>
  15.  
  16.      cchhaarr **
  17.      ttmmppnnaamm((_s)
  18.  
  19.      cchhaarr **
  20.      tteemmppnnaamm((_d_i_r, _p_r_e_f_i_x)
  21.  
  22. AARRGGUUMMEENNTTSS
  23.      char *_s   _i_n/_o_u_t           Place  to  store  temporary  file
  24.                                 name.   If  NNUULLLL,  store  name in
  25.                                 local static storage that will be
  26.                                 overwritten   on   next  call  to
  27.                                 ttmmppnnaamm.   If  not  NNUULLLL,  _s  must
  28.                                 point  to  a buffer containing at
  29.                                 least LL__ttmmppnnaamm bytes.
  30.  
  31.      char *_d_i_r _i_n               Directory in which  to  temporary
  32.                                 file  should reside.  If NNUULLLL, or
  33.                                 if  _d_i_r  is  not  an   accessible
  34.                                 directory, defaults to PP__ttmmppddiirr.
  35.  
  36.      char   *_p_r_e_f_i_x   (in)      First few letters to use for name
  37.                                 of temporary file.
  38.  
  39. _________________________________________________________________
  40.  
  41.  
  42. DDEESSCCRRIIPPTTIIOONN
  43.      The procedures ttmmppnnaamm and tteemmppnnaamm generate unique file names
  44.      suitable  for  temporary  files.   Each  procedure returns a
  45.      pointer to the name it generated,  except  that  under  some
  46.      conditions  (such as inability to allocate memory, for exam-
  47.      ple) tteemmppnnaamm will fail to generate a file name.   When  this
  48.      happens, tteemmppnnaamm will return NNUULLLL.
  49.  
  50.      TTmmppnnaamm generates file names that refer to a standard  direc-
  51.      tory  defined  by  PP__ttmmppddiirr (currently //uussrr//ttmmpp).  Each time
  52.      ttmmppnnaamm is called it will return a different file name, which
  53.      does not refer to any existing file.
  54.  
  55.      TTeemmppnnaamm is similar to ttmmppnnaamm except that  it  provides  more
  56.      flexibility.  The _d_i_r argument may be used to specify a par-
  57.      ticular directory to which the generated name should  refer.
  58.      If  this  is not an accessible directory, then PP__ttmmppddiirr will
  59.      be used.  If this directory is not accessible  either,  then
  60.      //ttmmpp  will be used as a last resort.  If the TTMMPPDDIIRR environ-
  61.      ment  variable  is  defined  and  refers  to  an  accessible
  62.  
  63.  
  64.  
  65. Sprite v.1.0        Printed:  October 3, 1989                   1
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. tmpnam                C Library Procedures                 tmpnam
  73.  
  74.  
  75.  
  76.      directory, then it will override any of the above choices.
  77.  
  78.      The _p_r_e_f_i_x argument may be used to  specify  the  first  few
  79.      letters  of the last component of the path name generated by
  80.      tteemmppnnaamm.  TTeemmppnnaamm dynamically allocates space for  the  name
  81.      using  mmaalllloocc.   It  is  the responsibility of the caller to
  82.      release this storage by passing the returned string to  ffrreeee
  83.      when it is no longer needed.
  84.  
  85. KKEEYYWWOORRDDSS
  86.      file name, temporary, unique
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. Sprite v.1.0        Printed:  October 3, 1989                   2
  132.  
  133.  
  134.  
  135.